const request = require('../../utils/kzj.request.js');
/**
 * 每一个页面对应一个contoller
 */
class controllerIndex {

  /**
   * 登录
   * @return {Promise}
   */
  //第三方支付
  weChatPay(params) {
    return request.post(`/api/pay/weChatPay`, params).then(res => res.data)
  }
  //更新拼团活动
  updateButton(params) {
    return request.post(`/api/market/updateButton`, params).then(res => res.data)
  }
  saveOrder(params) {
    return request.post(`/api/offline/order/save`, params).then(res => res.data)
  }

  //新增拼团活动
  newGroup(params) {
    return request.post(`/api/market/save`, params).then(res => res.data)
  }
  //支付成功接口
  paySucess(params) {
    return request.post(`/api/bug/paySuccess`, params, false).then(res => res.data)
  }
  //获取续费列表
  getBillList(params) {
    return request.post(`/api/renew/list`, params).then(res => res.data)
  }
  //获取商品分页
  labelGoodsPage(params) {
    return request.post(`/api/goods/labelGoodsPage`, params).then(res => res.data)
  }

  orderDetail(params) {
    return request.post(`/api/offline/order/orderDetail`, params).then(res => res.data)
  }

  canUseCoupon(params) {
    return request.post(`/api/coupon/canUseCoupon`, params).then(res => res.data)
  }


  cancelOrder(params) {
    return request.post(`/api/offline/order/cancelOrder`, params).then(res => res.data)
  }

  settlementOrder(params) {
    return request.post(`/api/offline/order/settlementOrder`, params).then(res => res.data)
  }


  //新增商品分页
  shopLabelGoodsPage(params) {
    return request.post(`/api/goods/shopLabelGoodsPage`, params).then(res => res.data)
  }

  //未分类商品分页
  noLabelGoodsPage(params) {
    return request.post(`/api/goods/noLabelGoodsPage`, params).then(res => res.data)
  }

  //会员卡活动列表
  vipShopList(params) {
    return request.post(`/api/vip/shopList`, params).then(res => res.data)
  }
  vipDetails(params) {
    return request.post(`/api/vip/details`, params).then(res => res.data)
  }


  openVip(params) {
    return request.post(`/api/vip/openVip`, params).then(res => res.data)
  }

  //上架商品
  setCloudUp(params) {
    return request.post(`/api/goods/setCloudUp`, params).then(res => res.data)
  }

  //下架商品
  setCloudLow(params) {
    return request.post(`/api/goods/setCloudLow`, params).then(res => res.data)
  }
  //移动分类
  moveLabel(params) {
    return request.post(`/api/label/moveLabel`, params).then(res => res.data)
  }
  //del分类
  delLabel(params) {
    return request.post(`/api/label/delLabel`, params).then(res => res.data)
  }


  setGoodsSort(params) {
    return request.post(`/api/goods/setGoodsSort`, params).then(res => res.data)
  }


  // 素材中心（获取店铺页面的轮播图）
  shopRotationImg(params) {
    return request.post(`/api/img/shopRotationImg`, params).then(res => res.data)
  }
  // 素材中心（获取店铺页面的轮播图和视频）
  shopRotationImgAndVideo(params) {
    return request.post(`/api/img/shopRotationImgAndVideo`, params).then(res => res.data)
  }
  // 素材中心（新增店铺页面的商品轮播图）
  saveShopIndex(params) {
    return request.post(`/api/img/saveShopIndex`, params).then(res => res.data)
  }
  // 素材中心（修改店铺页面的商品轮播图）
  updateShopIndex(params) {
    return request.post(`/api/img/updateShopIndex`, params).then(res => res.data)
  }
  // 素材中心（删除店铺页面的商品轮播图）
  delImg(params) {
    return request.post(`/api/img/delImg`, params).then(res => res.data)
  }

  //生成续费订单
  comfirmBill(params) {
    return request.post(`/api/order/renewOrder`, params).then(res => res.data)
  }
  //根据标签获取商品分页信息
  labelGoodsPage(params) {
    return request.post(`/api/goods/labelGoodsPage`, params).then(res => res.data)
  }

  //获取标签列表
  selectLabel(params) {
    return request.post(`/api/label/selectLabel`, params).then(res => res.data)
  }
  //获取续费记录列表
  getBillRecord(params) {
    return request.post(`/api/renew/renewRecord`, params).then(res => res.data)
  }

  //获取店铺租金累计金额
  getBillAll(params) {
    return request.post(`/api/renew/totalRenewMoney`, params).then(res => res.data)
  }

  //获取店铺活动
  getShopActive(params) {
    return request.post(`/api/shop/getActivityNum`, params).then(res => res.data)
  }

  //获取拼团活动列表
  getGroupList(params) {
    return request.post(`/api/market/shopMarketPage`, params).then(res => res.data)
  }

  //获取拼团活动详情
  getGroupDetail(params) {
    return request.post(`/api/market/detail`, params).then(res => res.data)
  }

  //新增拼团活动
  newGruop(params) {
    return request.post(`/api/market/save`, params).then(res => res.data)
  }
  //获取店铺活动说明
  getActiveTip(params) {
    return request.post(`/api/content/listByType`, params, false).then(res => res.data)
  }

  //获取店铺服务说明复数
  getActiveTips(params) {
    return request.post(`/api/content/listByTypes`, params, false).then(res => res.data)
  }

  //优惠券列表
  getCouponList(params) {
    return request.post(`/api/coupon/shopActivityPage`, params).then(res => res.data)
  }
  //可用优惠券列表
  canUseCouponList(params) {
    return request.post(`/api/coupon/activityPage`, params).then(res => res.data)
  }
  shopInfo(params) {
    return request.post(`/api/shop/shopIndex`, params).then(res => res.data)
  }
  //员工列表
  staffList(params) {
    return request.post(`/api/shop/staffList`, params).then(res => res.data)
  }
  //是否可以添加商品
  haveGoods(params) {
    return request.post(`/api/goods/haveGoods`, params).then(res => res.data)
  }

  //新增员工
  saveStaff(params) {
    return request.post(`/api/shop/saveStaff`, params).then(res => res.data)
  }
  //更新员工
  updateStaff(params) {
    return request.post(`/api/shop/updateStaffState`, params).then(res => res.data)
  }

  //员工详情
  staffDetail(params) {
    return request.post(`/api/shop/staffDetail`, params).then(res => res.data)
  }
  //员工订单详情
  staffPage(params) {
    return request.post(`/api/order/staffPage`, params).then(res => res.data)
  }
  //员工提成列表
  commissionList(params) {
    return request.post(`/api/commission/list`, params).then(res => res.data)
  }


  shopGoods(params) {
    return request.post(`/api/bill/shopGoodsPage`, params).then(res => res.data)
  }
  //shousuo商品
  searchGood(params) {
    return request.post(`/api/goods/shopGoodsPage`, params).then(res => res.data)
  }
  //获取云商品列表
  cloutShopGoodsPage(params) {
    return request.post(`/api/goods/cloutShopGoodsPage`, params).then(res => res.data)
  }



  saveBill(params) {
    return request.post(`/api/bill/saveBill`, params).then(res => res.data)
  }
  //查询会员开卡信息
  checkVIPlist(params) {
    return request.post(`/api/vip/selectAccount`, params).then(res => res.data)
  }

  getVIPDetail(params) {
    return request.post(`/api/vip/details`, params).then(res => res.data)
  }



  //查询线下订单记录
  selectOrder(params) {
    return request.post(`/api/offline/order/selectOrder`, params).then(res => res.data)
  }
  totalOfflineBusiness(params) {
    return request.post(`/api/shop/totalOfflineBusiness`, params).then(res => res.data)
  }
  offlineBusiness(params) {
    return request.post(`/api/shop/offlineBusiness`, params).then(res => res.data)
  }



  //根据手机号查询用户
  selectByMobile(params) {
    return request.post(`/api/account/selectByMobile`, params).then(res => res.data)
  }

  //根据标签获取商品分页信息
  labelGoodsPage(params) {
    return request.post(`/api/goods/labelGoodsPage`, params).then(res => res.data)
  }

  //获取标签列表
  selectLabel(params) {
    return request.post(`/api/label/selectLabel`, params).then(res => res.data)
  }
  selectById(params) {
    return request.post(`/api/label/selectById`, params).then(res => res.data)
  }
  //查询行业分类下标签
  selectByTypeId(typeId) {
    return request.get(`/api/label/selectByTypeId?typeId=` + typeId).then(res => res.data)
  }
  addLabel(params) {
    return request.post(`/api/label/addLabel`, params).then(res => res.data)
  }



  shopTypeList(params) {
    return request.post(`/api/shop/shopTypeList`, params).then(res => res.data)
  }
  accountList(params) {
    return request.post(`/api/shop/accountList`, params).then(res => res.data)
  }
  accountListPage(params) {
    return request.post(`/api/shop/accountPage`, params).then(res => res.data)
  }
  accountDetail(params) {
    return request.post(`/api/shop/accountDetail`, params).then(res => res.data)
  }
  // 上下架图片
  setGoodsState(params) {
    return request.post(`/api/goods/setGoodsState`, params).then(res => res.data)
  }
  //SHANGJIA
  setCloudUp(params) {
    return request.post(`/api/goods/setCloudUp`, params).then(res => res.data)
  }
  setCloudLow(params) {
    return request.post(`/api/goods/setCloudLow`, params).then(res => res.data)
  }
  // 获取新增商品模板 (店铺端)
  selectGoodsTemp(params) {
    return request.post(`/api/goods/selectGoodsTemp`, params, false).then(res => res.data)
  }

  // 新增(商品/服务)
  saveGoods(params) {
    return request.post(`/api/goods/saveGoods`, params).then(res => res.data)
  }
  //新增所属
  getSetByParentId(params) {
    return request.post(`/api/label/getSetByParentId`, params).then(res => res.data)
  }
  //平台推荐云商品列表
  recommendCloutGoodsPage(params) {
    return request.post(`/api/goods/recommendCloutGoodsPage`, params).then(res => res.data)
  }
  //门店推荐云商品列表
  shopRecommendCloutGoodsPage(params) {
    return request.post(`/api/goods/shopRecommendCloutGoodsPage`, params).then(res => res.data)
  }
  //删除过期拼团
  deleteGruop(params) {
    return request.post(`/api/market/delete`, params).then(res => res.data)
  }

  //获取新增商品模板详情
  goodsTempDetail(params) {
    return request.post(`/api/goods/goodsTempDetail`, params).then(res => res.data)
  }



  //创建会员
  createAccount(params) {
    return request.post(`/api/account/createAccount`, params).then(res => res.data)
  }


  //获取二维码链接
  getCode(params) {
    return request.post(`/api/share/createAccountQrCode`, params).then(res => res.data)
  }

  //根据模板id新增商品
  saveByTempIds(params) {
    return request.post(`/api/goods/saveByTempIds`, params).then(res => res.data)
  }

  //设置用户会员等级
  updataVip(params) {
    return request.post(`/api/vip/setVip`, params).then(res => res.data)
  }

  //新增店铺页面弹窗
  setPoster(params) {
    return request.post(`/api/img/setPoster`, params).then(res => res.data)
  }

  //获取弹窗
  getPoster(params) {
    return request.post(`/api/img/poster`, params).then(res => res.data)
  }

  //新增店铺首页轮播图视频
  updateVideo(params) {
    return request.post(`/api/shop/updateVideo`, params).then(res => res.data)
  }

//删除店铺首页轮播图视频
delVideo(params) {
  return request.post(`/api/shop/delVideo`, params).then(res => res.data)
}


  //备注用户信息
  setAccountDesc(params) {
    return request.post(`/api/shop/setAccountDesc`, params).then(res => res.data)
  }

  // //获取员工列表
  // getStaffList(params){
  //   return request.post(`/api/shop/shopStaff`,params).then(res =>res.data)
  // }

  //结算
  settlementMoney(params) {
    return request.post(`/api/commission/settlement`, params).then(res => res.data)
  }

  //获取员工列表
  getStaffList(params) {
    return request.post(`/api/shop/shopStaff`, params).then(res => res.data)
  }

  //删除员工
  delStaff(params) {
    return request.post(`/api/shop/delShopStaff`, params).then(res => res.data)
  }

  //获取系统设置内容
  getConfig(params) {
    return request.post(`/api/configure/page`, params).then(res => res.data)
  }

  //获取店铺视频费用列表
  renewShopVideoList(params) {
    return request.post(`/api/renew/renewShopVideoList`, params).then(res => res.data)
  }

//生成视频上传订单
renewShopVideoOrder(params) {
  return request.post(`/api/order/renewShopVideoOrder`, params).then(res => res.data)
}


  //生成开通服务订单
  configOrder(params) {
    return request.post(`/api/order/configOrder`, params).then(res => res.data)
  }


  //同意提现
  shopStaffSuccess(params) {
    return request.post(`/api/withdraw/shopStaffSuccess`, params).then(res => res.data)
  }

  //拒绝提现
  shopStaffFail(params) {
    return request.post(`/api/withdraw/shopStaffFail`, params).then(res => res.data)
  }

  //提现记录
  shopStaffPage(params) {
    return request.post(`/api/withdraw/shopStaffPage`, params).then(res => res.data)
  }

  //员工订单列表(线上，云服务)
  staffOrderPage(params) {
    return request.post(`/api/order/staffOrderPage`, params).then(res => res.data)
  }
  //线下订单
  selectOrder(params) {
    return request.post(`/api/offline/order/selectOrder`, params).then(res => res.data)
  }
  //线下预约
  shopPage(params) {
    return request.post(`/api/goods/agree/shopPage`, params).then(res => res.data)
  }
  //提成记录
  orderStaff(params) {
    return request.post(`/api/order/staffPage`, params).then(res => res.data)
  }
  //删除邀请函
  invitationDelete(params) {
    return request.post(`/api/invitation/delete`, params).then(res => res.data)
  }
  //新增邀请函列表
  invitationSave(params) {
    return request.post(`/api/invitation/save`, params).then(res => res.data)
  }
  //商家查看邀请函列表
  invitationShopPage(params) {
    return request.post(`/api/invitation/shopPage`, params).then(res => res.data)
  }
  //设置邀请函结束
  invitationSetOver(params) {
    return request.post(`/api/invitation/setOver`, params).then(res => res.data)
  }
  //邀请函领取列表 
  receivePage(params) {
    return request.post(`/api/invitation/receivePage`, params).then(res => res.data)
  }
  //邀请函详情 
  invitationDetail(params) {
    return request.post(`/api/invitation/invitationDetail`, params).then(res => res.data)
  }
  //商家发送邀请函 
  shopSendInvitation(params) {
    return request.post(`/api/invitation/shopSendInvitation`, params).then(res => res.data)
  }

  //会员卡订单列表 
  vipOrderPage(params) {
    return request.post(`/api/order/vipPage`, params).then(res => res.data)
  }

  
  //商圈活动订单列表 
  couponBagPage(params) {
    return request.post(`/api/order/couponBagPage`, params).then(res => res.data)
  }

   //批量设置商品状态（上下架）
   batchSetGoodsState(params) {
    return request.post(`/api/goods/batchSetGoodsState`, params).then(res => res.data)
  }

   //批量商品添加分类 
   batchSetGoodsLabel(params) {
    return request.post(`/api/goods/batchSetGoodsLabel`, params).then(res => res.data)
  }

   //批量商品移除分类 
   batchDelGoodsLabel(params) {
    return request.post(`/api/goods/batchDelGoodsLabel`, params).then(res => res.data)
  }

  //批量删除商品
  batchDelGoods(params) {
    return request.post(`/api/goods/batchDelGoods`, params).then(res => res.data)
  }

  
  //店铺订单统计
  orderStatistics(params) {
    return request.post(`/api/shop/orderStatistics`, params).then(res => res.data)
  }

  //商圈订单统计
  bagOrderStatistics(params) {
    return request.post(`/api/shop/bagOrderStatistics`, params).then(res => res.data)
  }


}
/**
 * 实例化对象
 */
let Controller = new controllerIndex();
/**
 * 暴露对象，无需每次都加函数名
 */
module.exports = {
  controller: Controller
}